import request from '@/utils/request'

// 查询主分类列表
export function listMain(query) {
  return request({
    url: '/service/main/list',
    method: 'get',
    params: query
  })
}

// 查询所有主分类
export function all() {
  return request({
    url: '/service/main/all',
    method: 'get'
  })
}

// 查询主分类详细
export function getMain(id) {
  return request({
    url: '/service/main/getById/' + id,
    method: 'get'
  })
}

// 新增主分类
export function addMain(data) {
  return request({
    url: '/service/main',
    method: 'post',
    data: data
  })
}

// 修改主分类
export function updateMain(data) {
  return request({
    url: '/service/main',
    method: 'put',
    data: data
  })
}

// 删除主分类
export function delMain(id) {
  return request({
    url: '/service/main/' + id,
    method: 'delete'
  })
}


